package org.flintparticles.common.stage3d
{
	import com.adobe.utils.AGALMiniAssembler;

	public class ShaderList
	{
		public function ShaderList()
		{
		}
	
		public static const QUAD_VERT:String=
		    "m44 op, va0, vc0  \n" +  // 4x4 matrix transform to output clipspace
			"mov v0, va1       \n"   ; // pass color to fragment program 
		
		
		public static const QUAD_VERT_MTR:String=
			"m44 vt0, va0, vc0 \n"+// Transform position by modelview matrix
		    "m44 op, vt0, vc4  \n"+///transform by projection matrix      
			"mov v0, va1       \n"   ; // pass color to fragment program 
		
		public static const IMAGE_VERT_MTR:String =
			"m44 vt0, va0, vc0  \n" +  // 4x4 matrix transform to output clipspace
			"m44 op, vt0, vc4  \n"+
			"mov v0, va1       \n" +  // pass color to fragment program
			"mov v1, va2       \n";   // pass texture coordinates to fragment program

		
		///////color as separate buffer//////////
		public static const BATCH_QUAD_VERT_MTR_COL:String=
			"m44 vt0, va0, vc0 \n"+// Transform position by modelview matrix
			"m44 op, vt0, vc4  \n"+///transform by projection matrix      
			"mov v0, va1       \n"   ; // pass color to fragment program 
		
		////////////////////fragment programs//////////////////////
		public static const QUAD_FRAG:String=
			"mul ft0, v0, fc0  \n" +  // multiply alpha (fc0) by color (v0)
			"mov oc, ft0       \n"  ;  // output color
		public static const QUAD_FRAG_NO_ALPHA_MULT:String=
			//"mul ft0, v0, fc0  \n" +  // multiply alpha (fc0) by color (v0)
			"mov oc, v0       \n"  ;  // output color
		////THis shader program calculates the MVP Matrix on the GPU
		public static const IMAGE_FRAG:String =
			"tex ft1, v1, fs1 <2d,repeat,linear> \n" +  // sample texture 1
			"mul ft2, ft1, v0       \n" +  // multiply color with texel color
			
			"mul ft3, ft2, fc0       \n"+///// multiply color with alpha
		  //  "div ft3.xyz, ft3.xyz, ft3.w \n"+  
		    "mov oc, ft3   \n" ;
		
		/////////massive particles rendering programs
		
		public static const MASS_VERT:String=
			///	"add vt0, va0, va2  \n"+
			"m44 op, va0, vc0  \n"+///mult by mv matrix
			///	"m44 vt0, vt0, vc0  \n"+///mult by persp matrix
			//	"mov op, vt0        \n"+
			"mov v0, va1        \n"+
			"mov v1, va2       \n"; 
		public static const MASS_FRAG:String=
			"tex ft1, v1.xy, fs1 <2d,clamp,linear> \n" +  // sample texture 1
			//	"tex ft0, v1, fs2 <2d,repeat,linear> \n"+
			//	"add ft0, ft0, ft1 \n"+
			//	"mov oc, ft0\n";
			"mul ft1, ft1, v0  \n"+///	mul ft0, ft0, v1
			"mul ft1, ft1, v0  \n"+
			"add oc, ft1, ft1 \n";
		
		
		///"mov oc, ft1       \n"  ;  // output color
		
		/*
		"tex ft1, ft0, fs0<2d,repeat,linear>\n";
		"tex ft0, ft0, fs1<2d,repeat,linear>\n";
		code += "tex ft0, ft0, fs1<2d,repeat,linear>\n";
		code += "add ft0, ft0, ft1\n";
		code += "mov oc, ft0\n";
		
		*/
		public static const MASS_FRAG_safe:String=
			"mul ft0, v0, fc0  \n" +  // multiply alpha (fc0) by color (v0)
			"mov oc, ft0       \n"  ;  // output color
	}
}